package com.usian.day02.order.client.controller;

import com.usian.common.model.day02.Order;
import com.usian.common.vo.ResultResopnse;
import com.usian.day02.order.client.fegin.OrderFegin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2023/7/27 9:15
 */
@RestController
@RequestMapping("/order")
public class OrderClientController {

    @Autowired
    OrderFegin orderFegin;


    @GetMapping("list")
    public ResultResopnse list(){
        return orderFegin.list();
    }

    @PostMapping("/save")
    public ResultResopnse save(@RequestBody Order order){
        return orderFegin.save(order);
    }

    @GetMapping("{id}")
    public ResultResopnse findByid(@PathVariable String id){
        return orderFegin.findById(id);
    }

}
